Chapter 1 - Introduction
Verificación: ¿estamos construyendo el producto correctamente?
Validación: ¿estamos construyendo el producto correcto?
Las pruebas pueden hacerse para obtener información del producto, permitiendo tomar decisiones. Planearlas y diseñarlas es parte del proceso. Tienen condiciones, y pueden combinarse una tras otra para crear escenarios.
El objetivo del testing es la verificación y validación. En ambas se puede hacer inspección y revisión de código. Las inspecciones pueden encontrar varios errores, temas de calidad y hacerse sobre versiones incompletas. La confianza que se debe tener para el sistema depende de su propósito (cuanto más crítico, más seguro debe ser), las expectativas de los usuarios y el mercado.
Fallo -> no hace lo requerido (o hace algo que no debería)
Motivos:
O sea, los defectos en los req., diseño o código causan fallos. Por lo tanto, no puede decirse que el código tiene fallos, pero sí defectos.
Objetivo: detectar y corregir estos defectos antes de liberar el producto.
Testing (probar): no es debugging.
La idea es registrar los tipos de defectos.
Objetivo de prueba o tipo de prueba
Técnica de prueba
Objeto de prueba
Nivel de prueba
Perfil de persona que prueba
Grado de prueba
Bases de prueba
Caso de prueba
Risk (riesgo):
failure: actual result != expected result
faults: bugs
defect masking: a fault is hidden by one or more other faults in other parts of the program
cause of bug/fault: error or mistake by a person
test: a sample examination
test object
test conditions
test process: execution of the test object with test data, planning, design, implementation, and analysis of the test
test run / test suite: includes execution of one or more test cases
test scenarios: several test cases combined whereby the result of one test case is used as the starting point for the next test case
A software system cannot fulfill every quality characteristic equally well. Quality characteristics must therefore be prioritized.
a complete or exhaustive test is not feasible.
Test effort is often shown as the proportion between the number of testers and the number of developers.
But, is this high testing effort affordable and justifiable? The counter question is “Compared to what?”. When safety-critical systems fail, the lives and health of people may be in danger.
“Testing should continue as long as costs of finding and correcting a defect are lower than the costs of failure” (the cost must include all aspects of a failure, even the possible cost of bad publicity, litigation, etc., and not just the cost of correction, retesting, and distribution.)
Thus, for every software program it must be decided how intensively and thoroughly it shall be tested. This decision must be made based upon the expected risk of failure of the program.
There exist many different methods and techniques for testing software. Every technique especially focuses on and checks particular aspects of the test object. A combination of different test techniques is always necessary.
Execution of such a substantial task as testing must not take place without a plan. Planning of the test process starts at the beginning of the software development project.
The mission and objectives of testing must be defined and agreed upon as well as the resources necessary for the test process. Which employees are needed for the execution of which tasks and when? How much time is needed, and which equipment and utilities must be available? These questions and many more must be answered during planning, and the result should be documented in the test plan.
Test control is the monitoring of the test activities and comparing what actually happens during the project with the plan. It includes reporting the status of deviations from the plan and taking any actions necessary to meet the planned goals in the new situation.
The main task of planning is to determine the test strategy or approach.
Priorities must be set based on risk assessment.
The test activities must be distributed to the individual subsystems, depending on the expected risk and the severity of failure effects. Critical subsystems must get greater attention, thus be tested more intensively.
The goal of the test strategy is the optimal distribution of the tests to the “right” parts of the software system.
If the necessary tool support does not exist, selection and acquisition of tools must be initiated early. Existing tools must be evaluated if they are updated. If parts of the test infrastructure have to be developed, this can be prepared. Test harnesses (or test beds), where subsystems can be executed in isolation, must often be programmed.
Review the test basis, i.e., the specification of what should be tested.
The specification should be concrete and clear enough to develop test cases. The basis for the creation of a test can be the specification or architecture documents, the results of risk analysis, or other documents produced during the software development process.
Includes checking the ease with which interfaces can be addressed (interface openness) and the ease with which the test object can be separated into smaller, more easily testable units.
It is important to ensure traceability between the specifications to be tested and the tests themselves.
It must be clear which test cases test which requirements and vice versa.
Logical test cases have to be defined first. After that, the logical test cases can be translated into concrete, physical test cases, meaning the actual inputs are selected.
For each test case, the initial situation (precondition) must be described. It must be clear which environmental conditions must be fulfilled for the test. Furthermore, before test execution, it must be defined which results and behaviors are expected. The results include outputs, changes to global (persistent) data and states, and any other consequences of the test case.
To define the expected results, the tester must obtain the information from some adequate source. In this context, this is often called an oracle, or test oracle. A test oracle is a mechanism for predicting the expected results. The specification can serve as a test oracle.
One must describe how the tests will be executed.
Test cases should be grouped into test suites or test scenarios for efficient execution and better understanding.
Specific test harnesses (drivers, simulators, etc.), must be programmed, built, acquired, or set up as part of the test environment before the test cases can be executed.
Start test execution with the examination of the test object’s main functionality (smoke test).
If failures or deviations from the expected result show up at this time, it is foolish to continue testing.
Execution must be exactly and completely logged.
If a difference shows up, it must be decided when evaluating the test logs if the difference really indicates a failure. If so, the failure must be documented.
Nothing is more detrimental to the credibility of a tester than reporting a supposed failure whose cause is actually a test problem.
A decision must be made about how to prioritize fault corrections.
After faults are corrected, the tester must make sure the fault has really been corrected and that no new faults have been introduced.
In many projects, there is not enough time to execute all specified test cases.
This is called risk-based testing.
During test evaluation and reporting, the test object is assessed against the set test exit criteria specified during planning.
This may result in normal termination of the tests if all criteria are met, or it may be decided that additional test cases should be run or that the criteria were too hard.
Considering the risk, an adequate exit criterion must be determined for each test technique used.
Analysis of the problem can also show that the necessary effort to fulfill the exit criteria is not appropriate.
In that situation, further tests are canceled. Such a decision must consider the associated risk.
A further case of not meeting test exit criteria may occur if the specified criterion is impossible to fulfill in the specific case. If, for example, the test object contains dead code.
The failures found during the test should be repaired, after which a new test becomes necessary. This repeats and creates the test cycle.
If this cycle is ignored while planning, then the project will be delayed.
In practice, the end of a test is often defined by factors that have no direct connection to the test: time and costs.
Faults delivered in the product mostly cause higher costs when found during operation.
When the test criteria are fulfilled or a deviation from them is clarified, a test summary report should be written for the stakeholders. In lower-level tests, this may just take the form of a message to the project manager about meeting the criteria. In higher-level tests, a formal report may be required.
The experience gathered during the test work should be analyzed and made available for future projects.
Questions:
The “conservation” of the testware for the future.
A major part of the test effort during maintenance can be avoided if the testware (test cases, test logs, test infrastructure, tools, etc.) is still available.
If a developer implemented a fundamental design error—for example, if she misunderstood the task—then she will not find this using her own tests.
On the other hand, it is advantageous to have a deep knowledge of one’s own test object.
Management has to decide.
An independent testing team is beneficial for test quality and comprehensiveness.
Developers should know the basics of testing and testers should have a basic knowledge of software development.
Such data or documents must be handled appropriately and must not get into the wrong hands or be misused.
Se ven los niveles de prueba:
Primer nivel de prueba: verificación unitaria o de componentes.
Es importante probar:
Simula la actividad del componente omitido.
Pieza de código que simula el uso (por otro módulo) del módulo que está siendo testeado.
Typical test objects are program modules/units or classes, (database) scripts, and other software components.
Components are tested individually and isolated from all other software components of the system.
If testing detects a problem, it is definitely a problem originating from the component under test itself.
Los objetos de prueba vienen directamente del “escritorio del programador”, por lo tanto requiere un alto nivel de cooperación con desarrollo.
The most important task is to check that the entire functionality of the test object works correctly and completely as required by its specification.
Typical software defects found during functional component testing are incorrect calculations or missing or wrongly chosen program paths.
Testing for robustness is another very important aspect of component testing. A strongly used component should not just suspend its service or cause the whole system to crash. Rather, it should be able to handle the situation in a reasonable and robust way.
Such test cases are also called negative tests.
Refers to how efficiently the component uses computer resources.
A test object’s efficiency can be measured during the test.
A maintainability test includes all the characteristics of a program that have an influence on how easy or how difficult it is to change the program or to continue developing it.
Aspects:
Analysis of the program text and the specifications is necessary. Static testing, and especially reviews are the correct means for that purpose.
Segundo nivel de prueba: testing de integración de unidades o componentes.
Las pruebas de integración suelen tener problemas con las interfaces, ya sea porque no se usan bien, no se entienden o hay diferencias en la velocidad de operación. La arquitectura de sistema determina los componentes y cómo se relacionan entre sí, y el plan de proyecto determina en qué momento se desarrollan las partes del sistema y cuándo están listas para ser probadas. Las pruebas top-down y bottom-up tienen ventajas y desventajas opuestas con respecto al uso y complejidad de stubs y drivers. Ad hoc requiere ambas cosas, lo cual es un problema, si bien ahorra tiempo.
Es importante probar:
A precondition for integration testing is that the test objects subjected to it (i.e., components) have already been tested. Defects should, if possible, already have been corrected.
Developers, testers, or special integration teams then compose groups of these components to form larger structural units and subsystems. This connecting of components is called integration.
Then the structural units and subsystems must be tested to make sure all components collaborate correctly. Thus, the goal of the integration test is to expose faults in the interfaces and in the interaction between integrated components.
The test basis may be the software and system design or system architecture, or workflows through several interfaces and use cases.
Interfaces to the system environment (i.e., external systems) are also subject to integration and integration testing.
In this cases we sometimes speak of system integration testing, higher-level integration testing, or integration testing in the large (integration of components is then integration test in the small, sometimes called component integration testing).
System integration testing can be executed only after system testing. The development team has only one-half of such an external interface under its control. This constitutes a special risk.
There may be several integration levels for test objects of different sizes. Component integration tests will test the interfaces between internal components or between internal subsystems. System integration tests focus on testing interfaces between different systems and between hardware and software.
Step-by-step, during integration, the different components are combined to form larger units.
Ideally, there should be an integration test after each of these steps. Each subsystem may then be the basis for integrating further larger units.
In component testing, such existing or standard components are probably not tested. In the integration test, however, these system components must be taken into account and their collaboration with other components must be examined.
Because the test objects are assembled components that have no interfaces to the “outside” other than their constituting components, it is obvious and sensible to reuse the available test drivers for component testing.
If the component test was well organized, then some test drivers should be available.
If a component test is poorly organized, there may be usable test drivers for only a few of the components.
During integration testing in a much later stage of the project, the tester will need to put a lot of effort into the creation, change, or repair of the test environment. Time needed for test execution is lost.
During integration testing, additional tools, called monitors, are required. Monitors are programs that read and log data traffic between components. Monitors for standard protocols (e.g., network protocols) are commercially available. Special monitors must be developed for the observation of project-specific component interfaces.
The test objectives of the test level integration test are clear: to reveal interface problems as well as conflicts between integrated parts.
When attempting to integrate two single components, their interface formats may not be compatible with each other because some files are missing or because the developers have split the system into completely different components than specified.
The harder-to-find problems, however, are due to the execution of the connected program parts. These kinds of problems can only be found by dynamic testing.
They are faults in the data exchange or in the communication between the components.
Of course, this is possible, and in practice it is regretfully often done, but only at the risk of great disadvantages:
Bottom-Up y Top-Down solo pueden usarse en sistemas estructurados de forma estrictamente jerárquica.
El objetivo es lograr combinar módulos o componentes individuales para que trabajen correctamente de forma conjunta
Tercer nivel de prueba: testing de sistema, en donde se comprueba que el sistema cumple con los requisitos especificados.
Es importante verificar:
Las pruebas de sistema se ejecutan desde el punto de vista del usuario final, y consideran interacciones de todos los componentes (que pueden no haber sido contempladas en las pruebas de integración).
Many functions and system characteristics result from the interaction of all system components; consequently, they are visible only when the entire system is present and can be observed and tested only there.
The system test tests the system as a whole in an environment as similar as possible to the intended production environment.
Instead of test drivers and stubs, the hardware and software products that will be used later should be installed on the test platform (hardware, system software, device driver software, networks, external systems, etc.). -> No drivers or stubs.
System test also checks system and user documentation, like system manuals, user manuals, training material, etc.
It is important to check the quality of data in systems that use a database or large amounts of data. This should be included in the system test. The data itself will then be new test objects. It must be assured that it is consistent, complete, and up-to-date.
Because of the complex test environment.
At the beginning of the system test, only half of the testing and quality control work has been done.
To validate whether the complete system meets the specified functional and nonfunctional requirements and how well it does that.
In many projects, the requirements are incompletely or not at all written down. So, it’s unclear how the system is supposed to behave. This makes it hard to find defects.
The consequences for those responsible for system testing are less desirable:
If the requirements are not specified, of course the developers do not have clear objectives either. Thus, it is very unlikely that the developed system will meet the implicit requirements of the customer.
In such projects, execution of the system test can probably only announce the collapse of the project.
Cuarto nivel de prueba: testing de aceptación, en donde se comprueba que el sistema es adecuado al uso y necesidades del cliente (puede realizarse como parte de las pruebas de niveles inferiores o distribuido en varios niveles de pruebas).
The acceptance test may be the only test that the customers are actually involved in or that they can understand.
For customer-specific systems, the risk is high and a comprehensive acceptance test is necessary.
At the other extreme, if a piece of standard software is introduced, it may be sufficient to install the package and test a few representative usage scenarios.
The test basis for acceptance testing can be any document describing the system from the user or customer viewpoint.
Las pruebas de aceptación contractuales se basan en contratos donde se definen los criterios de aceptación, que se usan para las pruebas.
Se hace cuando el producto es específico para un cliente. Si es un producto interno, el contrato es menos formal pero igualmente existe.
The test criteria are the acceptance criteria determined in the development contract. Additionally, conformance to any governmental, legal, or safety regulations must be addressed here.
Because the supplier may have misunderstood the acceptance criteria, it is very important that the acceptance test cases are designed by or at least thoroughly reviewed by the customer.
In contrast to system testing, which takes place in the producer environment, acceptance testing is run in the customer’s actual operational environment.
The acceptance test also checks the delivery and installation procedures.
Las pruebas de aceptación del usuario se hacen porque el cliente y el usuario final pueden ser diferentes.
Different user groups usually have completely different expectations of a new system. Users may reject a system because they find it “awkward” in some sense.
This may happen even if the system is completely OK from a functional point of view.
If major user acceptance problems are detected during acceptance testing, it is often too late to implement more than cosmetic countermeasures.
Las pruebas de aceptación operacionales se hacen con los administradores del sistema.
It may include testing of backup/restore cycles (including restoration of copied data), disaster recovery, user management, and checks of security vulnerabilities.
Las pruebas de campo se hacen cuando el software debe correr en muchos entornos diferentes y no se puede probar en todos. De este modo se pueden buscar problemas con ciertos entornos.
We speak of software maintenance when:
When a fault is detected, analyze which kind of testing would have detected this problem and will adequately improve or adapt the test plan.
If the production environment has been changed or the system is ported to a new environment (for example, by migration to a new platform), a new acceptance test should be run by the organization responsible for operations.
If data has to be migrated or converted, even this aspect must be tested for correctness and completeness.
There should be two strategies: one for emergency fixes (or “hot fixes”) and one for planned releases.
Testing for the retirement of a system should include the testing of data archiving or data migration into the future system.
An improved product version will be delivered at certain intervals, such as, e.g., once a year. It is best to synchronize these releases with the ongoing maintenance work. For example, every six months a new version is introduced: one maintenance update and one genuine functional update
As with maintenance testing, anything new or changed should be tested, and the remainder of the system should be regression tested to find unexpected side effects.
Incremental development means system functionality and reliability will grow over time. Testing must be adapted to such development models, and continuous integration testing and regression testing are necessary.
This danger can be reduced by running several V-models in sequence, one for each increment, where every next “V” reuses existing test material and adds the tests necessary for new development or for higher reliability requirements.
Functional testing includes all kind of tests that verify a system’s input/output behavior.
Black box testing methods are used, and the test bases are the functional requirements.
Uses the final requirements as the basis for testing. For each requirement, at least one test case is designed and documented in the test specification.
Usually, more than one test case is needed to test a functional requirement.
Requirements-based testing focuses on single system functions (e.g., the transmission of a purchase order).
A business process analysis (which is usually elaborated as part of the requirements analysis) shows which business processes are relevant and how often and in which context they appear.
Test scenarios simulating typical business processes are constructed based on this analysis.
It focuses on the whole process consisting of many steps (e.g., the sales conversation, consisting of configuring a car, agreeing on the purchase contract, and the transmission of the purchase order). This means a sequence of several tests.
Nonfunctional requirements do not describe the functions; they describe the attributes of the functional behavior or the attributes of the system as a whole.
The following nonfunctional system characteristics should be considered in the tests (usually in system testing):
Lo esencial es definir:
Structural techniques (structure-based testing, white box testing) use information about the test object’s internal code structure or architecture.
Includes:
Structural techniques are most used in component and integration testing, but they can also be applied at higher levels of testing.
Tanto en el mantenimiento como en procesos iterativos incrementales, es necesario realizar pruebas de regresión: verificar que los cambios o agregados realizados a la nueva versión no hayan degradado o “roto” el funcionamiento del sistema.
Thus, regression testing may be performed at all test levels and applies to functional, nonfunctional, and structural test. Test cases to be used in regression testing must be well documented and reusable. Therefore, they are strong candidates for test automation.
Simple local code changes can create side effects in any other, arbitrarily distant, system parts. If the test covers only altered or new code parts, it neglects the consequences these alterations can have on unaltered parts.
Opposite to dynamic testing, the test object is not provided with test data and executed but rather analyzed.
This can be done using one or more persons for an intensive investigation or through the use of tools.
Tool-supported static analysis is only possible for documents with a formal structure.
The goal of examination is to find defects and deviations from the existing specifications, standards to comply with, or even the project plan.
Reviews apply the human analytical capabilities to check and evaluate complex issues. Intensive reading and trying to understand the examined documents is the key.
There are different techniques for checking documents. They differ regarding the intensity, formality, necessary resources (staff and time), and goals.
Review is a common generic term for all the different static analysis techniques people perform as well as the term for a specific document examination technique.
Reviews rely on the colleagues of the author to provide mutual feedback. Because of this, they are also called peer reviews.
However, inspection is usually defined as a special, formal review using data collection and special rules.
Reviews are an efficient means to assure the quality of the examined documents. They should be performed as soon as possible to find mistakes and inconsistencies early.
Eliminating defects and inconsistencies leads to improved document quality and positively influences the whole development process.
In a badly moderated review session, the author may get into a psychologically difficult situation, feeling that he as a person and not the document is subject to critical scrutiny.
The costs caused by reviews are estimated to be 10–15% of the development budget.
Savings are estimated to be about 14–25% (the extra effort for the reviews themselves is included in this calculation.).
It is plausible that defect cost in development is reduced by 75% and more.
A review requires six work steps: planning, kick-off, individual preparation, review meeting, rework, and follow-up.
The kick-off (or overview) serves to provide those involved in the review with all of the necessary information.
It may include:
Those involved must have access to documents that help to decide if a particular statement is wrong or correct. Such documents are also called base documents or baselines.
The members of the review team must prepare individually for the review meeting.
A review leader or moderator leads the review meeting. Moderator and participants should behave diplomatically (not be aggressive with each other) and contribute to the review in the best possible way.
The manager decides whether to follow the recommendation or do something else.
The proper correction of defects must be followed up, usually by the manager, moderator, or someone especially assigned this responsibility.
If the result of the first review was not acceptable, another review should be scheduled.
Selecciona los artefactos a ser revisados, asigna los recursos necesarios y selecciona el equipo de revisión (generalmente no participa de la reunión de revisión).
The moderator is responsible for executing the review. Planning, preparation, execution, rework, and follow-up should be done in such a way that the review objectives are achieved.
The moderator is responsible for collecting review data and issuing the review report.
The author is the creator of the document that is the subject of a review. If several people have been involved in the creation, one person should be appointed to be responsible.
The author is responsible for the review object meeting its review entry criteria and for performing any rework required for meeting the review exit criteria.
The reviewers, sometimes also called inspectors, are several technical experts that participate in the review meeting after necessary individual preparation.
They should represent different viewpoints (for example, sponsor, requirements, design, code, safety, test).
The recorder (or scribe) shall document the issues (problems, action items, decisions, and recommendations) found by the review team.
A walkthrough is a informal review method with the purpose of finding defects, ambiguities, and problems in written documents. The author presents the document to the reviewers in a review meeting.
Se “recorre” el producto (o se simula su comportamiento en caso de ser código) en busca de defectos. Es bastante más informal que otros tipos de revisiones (inspecciones por ejemplo).
Goals:
The inspection is the most formal review. It follows a formal, prescribed process. Every person involved, usually people who work directly with the author, has a defined role. Rules define the process.
The reviewers use checklists containing criteria for checking the different aspects. Estas listas dependen del lenguaje de programación y de la organización. Por ejemplo revisan:
Se examinan arterfactos (no solo aplicables al código) buscando defectos comunes.
Goals:
The concrete objectives of each individual inspection are determined during planning.
In a technical review, the focus is compliance of the document with the specification, fitness for its intended purpose, and compliance to standards.
During preparation, the reviewers check the review object with respect to the specified review criteria.
The reviewers must be technically qualified.
Goals:
The informal review is a light version of a review. It more or less follows the general procedure for reviews in a simplified way.
Goals:
The type of review that should be used depends very much on how thorough the review needs to be and the effort that can be spent. It also depends on the project environment.
It makes sense to use testers as reviewers. The reviewed documents are usually used as the test basis to design test cases
Static analysis points to the fact that this form of checking does not involve an execution of the checked objects (of a program).
The objective of static analysis is, as with reviews, to reveal defects or defect-prone parts in a document. However, in static analysis, tools do the analysis.
Even spell checkers can be regarded as a form of static analyzers because they find mistakes in documents and therefore contribute to quality improvement.
The document to be analyzed must follow a certain formal structure in order to be checked by a tool.
Due to the fact that static analysis is tool supported, there is much less effort involved than in a review.
Not all defects can be found using static testing.
The following defects and dangerous constructions can be detected by static analysis:
Probar el sistema ejecutando el objeto de pruebas.
Tres categorías generales (refieren al diseño de los CP):
The test object (program) is fed with input data and executed. To do this, the program must be executable. In the lower test stages (component and integration testing), the test object cannot be run alone but must be embedded into a test harness or test bed to obtain an executable program.
The test bed must supply the test object with input data. In most cases, it is necessary to simulate a part of the program that is supposed to call the test object. A test driver does this. Driver and stub combined establish the test bed. Together, they constitute an executable program with the test object itself.
La estructura inherente o diseño del objeto de prueba no es considerado para el diseño de los casos de prueba.
Black box techniques are also called requirements-based testing techniques.
Algunas técnicas:
Clase de equivalencia: conjunto de entradas para las cuales suponemos que el software se comporta igual.
La experiencia muestra que los casos de prueba que exploran las condiciones límite producen mejor resultado que aquellas que no lo hacen.
Las condiciones límite son aquellas que se hallan “arriba” y “debajo” de los márgenes de las clases de equivalencia de entrada y de salida.
Diferencias con partición de equivalencia:
Ejemplos:
USAR EL INGENIO PARA ENCONTRAR CONDICIONES LÍMITE
In many systems, not only the current input but also the history of execution or events or inputs influences computation of the outputs and how the system will behave.
To illustrate the dependence on history, state diagrams are used. They are the basis for designing the test (state transition testing).
Finite state machines, state diagrams, and state transition tables model this behavior.
In state transition testing, the test object can be a complete system with different system states as well as a class in an object-oriented system with different states.
A state transition test should execute all specified functions of a state at Test criteria least once. Compliance between the specified and the actual behavior of the test object can thus be checked.
To identify the necessary test cases, the finite state machine is transformed into a so-called transition tree, which includes certain sequences of transitions.
The cyclic state transition diagram with potentially infinite sequences of states changes to a transition tree, which corresponds to a representative number of states without cycles.
The transition tree is built from a transition diagram this way:
It is a violation of the specification if functions are called in states where they should not be used (e.g., to delete the stack while in the “full” state). A robustness test must be executed to check how the test object works when used incorrectly. It should be tested to see whether unexpected transitions appear. The test can be seen as an analogy to the test of unexpected input values.
The previously introduced techniques look at the different input data independently. Dependencies among the different inputs and their effects on the outputs are not explicitly considered for test case design
Uses the dependencies for identification of the test cases.
The logical relationships between the causes and their effects in a component or a system are displayed in a so-called cause-effect graph.
Every cause is described as a condition that consists of input values (or combinations thereof). The conditions are connected with logical operators (e.g., AND, OR, NOT). The condition, and thus its cause, can be true or false. Effects are treated similarly and described in the graph.
The graph makes clear which conditions must be combined in order to achieve the corresponding effects.
The graph must be transformed into a decision table from which the test cases can be derived.
The steps to transform a graph into a table are as follows:
The objective for a test based on decision tables is that it executes “interesting” combinations of inputs.
Every column of this table is to be interpreted as a test case. From the table, the necessary input conditions and expected actions can be found directly.
From a decision table, a decision tree may be derived. The decision tree is analogous to the transition tree in state transition testing in how it’s used. Every path from the root of the tree to a leaf corresponds to a test case. Every node on the way to a leaf contains a condition that determines the further path, depending on its truth-value.
There are many research projects and approaches to directly derive test cases from UML diagrams and to generate these tests more or less automatically
The diagrams help define requirements on a relatively abstract level by describing typical user-system interactions. Testers may utilize use cases to derive test cases.
Use case diagrams mainly serve to show the external view of a system from the viewpoint of the user or to show the relation to neighboring systems.
Use cases and use case diagrams serve as the basis for determining test cases in use-case-based testing. As the external view is modeled, the technique is very useful for both system testing and acceptance testing. If the diagrams are used to model the interactions between different subsystems, test cases can also be derived for integration testing.
All of the following information is necessary for designing test cases and is often available in the diagrams:
However, the concrete input data and results for the individual test cases cannot be derived directly from the use cases. The individual input and output data must be chosen.
Black box testing will not be able to find problems where the implementation is based on incorrect requirements or a faulty design specification because there will be no deviation between the faulty specification or design and the observed results.
In addition, black box testing cannot reveal extra functionality that exceeds the specifications. (Such extra functionality is often the cause of security problems.)
The center of attention for all black box techniques is the verification of the functionality of the test object.
La derivación de los casos de prueba se basa en la estructura inherente o diseño del objeto de prueba. Son también llamadas técnicas basadas en la estructura o en el código.
The source code must be available, and in certain cases, it must be possible to manipulate it, that is, to add code.
Tipos de técnicas de caja blanca:
El foco de las técnicas de caja blanca es ejecutar (cubrir) cada parte del código al menos una vez.
El cubrimiento de ese código puede tener diferentes criterios:
This analysis focuses on each statement of the test object.
Asegura que el conjunto de casos de pruebas (CCP) ejecuta al menos una vez cada instrucción del código.
The first step is to translate the source code into a control flow graph. The graph makes it easier to specify in detail the control elements that must be covered.
After the edges are traversed, all statements have been executed once. Other combinations of edges of the graph can also be used to achieve complete coverage. But the cost of testing should always be minimized, which means reaching the goal with the smallest possible number of test cases.
The expected results and the expected behavior of the test object should be identified in advance from the specification (not the code!).
This time, the execution of decisions is considered instead of the execution of the statement. The result of the decision determines which statement is executed next. This should be used in testing.
Cada decisión dentro del código toma al menos una vez el valor true y otra vez el valor false para el CCP.
A branch is the connection between two nodes of the graph. In the program text, there are IF or CASE statements, loops, and so on, also called decisions. This test is thus called decision test or decision coverage.
The following example illustrates this: An IF statement with an empty ELSE-part is checked. Decision testing gives 50% coverage if the condition is evaluated to true. With one more test case where the condition is false, 100% decision coverage will be achieved. For the branch test, which is built from the control flow graph, slightly different values result. The THEN part consists of two branches and one node, the ELSE part only of one branch without any node (no statement there). Thus, the whole IF statement with the empty ELSE part consists of three branches. Executing the condition with true results in covering two of the three branches, that is, 66% coverage. (Decision testing gives 50% in this case). Executing the second test case with the condition being false, 100% branch coverage and 100% decision coverage are achieved. Branch testing is discussed further a bit later.
If a decision is based on several (partial) conditions connected by logical operators, then the complexity of the condition should be considered in the test.
The goal of condition testing is to cause each atomic (partial) condition in the test to adopt both a true and a false value.
Combinación de los dos criterios anteriores.
Todas las combinaciones posibles de resultados de condición dentro de una decisión se ejecuten al menos una vez.
Se ejecutan al menos una vez todos los caminos posibles (combinaciones de trayectorias).
Así como en el desarrollo, las actividades de testing necesitan ser organizadas. Las mismas deben ser coordinadas con las actividades de desarrollo.
Because there is a tendency to be blind to our own errors, it is much more efficient to organize testing as independently as possible from development.
For each of these models, it is advantageous to have testing consultants available. These consultants can support several projects and can offer methodical assistance in areas such as training, coaching, test automation, etc. Which of the previously mentioned models is appropriate depends on—among other things—the current test level.
Testing should be close to development.
Independent testing such as in model 1 is easy to organize and would certainly improve quality. Testing such as in model 2 is useful, if a sufficient number of testers relative to the number of developers can be made available.
However, with both testing models, there is the risk that the participating people essentially consider themselves developers and thus will neglect their testing responsibilities.
When the same team that developed the components also performs integration and integration testing, this testing can be organized as for component testing (models 1, 2).
Depending on the size of the development project and the number of components, models 3, 4, and 5 should be considered here.
The final product shall be considered from the point of view of the customer and the end user. Therefore, independence from the development team is crucial. This leaves only models 3, 4, and 5.
Specialists with knowledge covering the full scope of activities in the test process should be available.
The following roles should be assigned, ideally to specifically qualified employees:
Especially in system testing, it is often necessary to extend the test team by adding IT specialists, at least temporarily, to perform work for the test team. For example, these might be database administrators, database designers, or network specialists.
If appropriate resources are not available within the company, test activities can be given to external software testing service providers. This is similar to letting an external software house develop software.
Testing should not be the only measure for quality assurance (QA). It should be used in combination with other quality assurance measures.
Las actividades de verificación se deben planificar en mayor o menor grado, dependiendo y siendo coherente con el enfoque del proceso de desarrollo.
Permite que el personal técnico obtenga una visión global de las pruebas del sistema y ubique su propio trabajo en ese contexto.
Contents of a Software Quality Assurance Plan as defined in IEEE 730-2002:
A task as extensive as testing requires careful planning. This planning and test preparation starts as early as possible in the software project.
La V&V (verificación y validación) es un proceso caro se requiere llevar una planificación cuidadosa para obtener el máximo provecho de las revisiones y las pruebas para controlar los costos del proceso de V&V.
El mayor error cometido en la planificación de un proceso de prueba:
Suponer que no se encontrarán fallas al momento de realizar el cronograma.
Los resultados de esta equivocación son obvios:
The results are documented in the test plan. IEEE Standard 829-1998 [IEEE 829] provides a template.
This structure works well in practice. The sections listed will be found in real test plans in many projects in the same, or slightly modified, form.
The different level test plans are optional, depending on the criticality of the product developed.
Even with good planning and control, it is possible that the time and budget for the total test, or for a certain test level, are not sufficient for executing all planned test cases.
This means test cases must be prioritized.
Test cases should be prioritized so that if any test ends prematurely, the best possible test result at that point of time is achieved.
This way important problems can be found early.
Without prioritizing test cases, it is not possible to adequately allocate limited test resources. Concentration of resources on high-priority test cases is a MUST.
Defining clear test entry and exit criteria is an important part of test planning. They define when testing can be started and stopped (totally or within a test level).
Exit criteria are used to make sure test work is not stopped by chance or prematurely.
Vimos una amplia variedad de técnicas de prueba... ahora bien, ¿cuáles debería usar?
Factores que influencian: